<%@ page language="java" import="java.util.*,com.model.Employee" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/student.css">
    <script src="js/jquery-1.9.1.min.js"></script>
    <style type="text/css">
    	#mb {
			  -webkit-border-radius: 28;
			  -moz-border-radius: 28;
			  border-radius: 28px;
			  -webkit-box-shadow: 1px 1px 3px 0px #666666;
			  -moz-box-shadow: 1px 1px 3px 0px #666666;
			  box-shadow: 1px 1px 3px 0px #666666;
			  font-family: Arial;
			  color: #ffffff;
			  font-size: 16px;
			  background: #44c767;
			  padding: 12px 30px 12px 30px;
			  border: solid #18ab29 1px;
			  text-decoration: none;
			  heigh:50px;
			  margin-left:150px;
		}
			
		#mb:hover {
			 color: #ffffff;
		 	 background: #5cbf2a;
			 text-decoration: none;
		}
    </style>
</head>
<body>
    <div class="container">
        <div class="content">
            <div class="header clearfix">
                <div class="top fl">当前位置>个人信息</div>
                <div class="bottom fr">
                
                    
                </div>
            </div>
            <div class="main">
            	
                <!--基础信息-->
                <div class="BasicInformation">
                    <div class="title">
                        	基础信息
                    </div>
                </div>
                <form action="EmployeeServlet" method="post">
                <div class="content clearfix">
                    <div class="left fl">
                        <div>
                            <label for="">工号：</label>
                            <input id="xstu_id" name="eid" type="text" value="${sessionScope.employee.eid} " disabled>
                        </div>
                        <div>
                            <label for="">电话：</label>
                            <input id="birthday" name="ephone" type="text" value="${sessionScope.employee.ephone}" >
                        </div>
                        <div>
                            <label for="">家庭地址：</label>
                            <input id="idNumber" name="eaddress" class="id oInp" type="text" value="${sessionScope.employee.eaddress}" >
                        </div>
                    </div>
                    <div class="right fr">
                    	<div>
                            <label for="">姓名：</label>
                            <input id="stu_name" name="ename" type="text" value="${sessionScope.employee.ename}" disabled />
                        </div>
                        <div>
                            <label for="">所属地：</label>
                            <input id="national_name" name="wid" type="text" value="${sessionScope.employee.wid}" disabled>
                        </div>
                        
                        
                    </div>
                </div>
               
                	<input type="hidden" name="action" value="update">
                	<input type="submit" value="保存" style="margin-left: 200px;height: 40px">
                </form>
                
            </div>
        </div>
    </div>
    <script>
        $('#politics i').on('click', function() {
            $(this).siblings('ul').show();
        });
        $('#politics ul li').on('click', function() {
            var selTxt = $(this).text();
            $('#politics a').text(selTxt);
            $('#politics ul').hide();
        });
        $('#child i').on('click', function() {
            $(this).siblings('ul').show();
        });
        $('#child ul li').on('click', function() {
            var selTxt = $(this).text();
            $('#child a').text(selTxt);
            $('#child ul').hide();
        });
        $('#emit').on('click',function(){
			$('input').removeAttr('disabled');
		});
		$('#keep').on('click',function(){
			$('input').attr('disabled','disabled');
		});
    	$(document).ready(function(){
    		$.ajax({
	    		url: "http://101.201.154.205:9090/bm/bmList",
	    		type: 'post',
	    		data: {
	    			t: Math.random()
	    		},
	    		dataType: 'jsonp',
	    		'jsonp': 'callback'
	    	}).then(function(res){
	    		console.log(res)
	//      		var stu_name = $('#stu_name').val();
				for (var i=0; i<res.length; i++) {
	    			$('#stu_name').attr('value',res[i].stu_name);
	    			$('#sex').attr('value',res[i].sex);
	    			$('#xstu_id').attr('value',res[i].xstu_id);
	    			$('#idNumber').attr('value',res[i].idNumber);
	    			$('#birthday').attr('value',res[i].birthday);
	    			$('#national_name').attr('value',res[i].national_name);
	    			$('#qq').attr('value',res[i].qq);
	    			$('#phone').attr('value',res[i].phone);
	    			$('#e_mail').attr('value',res[i].e_mail);
	    			$('#pl_name').text(res[i].pl_name);
	    		}
	    	},function(){
	    		console.log('error');
	    	});
    	});
    </script>

</body>
</html>
